草庐IT

Android - 找不到 SwipeRefreshLayout 导入

全部标签

go - 为什么以下导入不起作用?

为什么以下内容有效packagemainimport("os"cli"github.com/urfave/cli")funcmain(){cli.NewApp().Run(os.Args)}但是当我按照https://github.com/urfave/cli中的建议将cli导入更改为以下内容时import("os"cli"gopkg.in/urfave/cli.v2")它给出了这个错误undefined:cli.NewApp 最佳答案 包的v2没有NewApp()方法。 关于go-为什

go - 如何从 Golang 中的相邻文件导入代码

是的,学习新编程语言时的典型问题。我有这个:$GOPATH/src/huru/foo/side.gohello.go在hello.go中我有:packagemainimport("encoding/json""log""net/http""github.com/gorilla/mux")funcmain(){Foo()}在foo/side.go中,我有:packagemainfuncFoo(){}我跑:goinstallhuru我得到:#hurusrc/huru/hello.go:22:2:undefined:Foo编译器不喜欢hello.go中的Foo()调用,我该如何正确导入它?我

找不到 Golang amazon s3 环境访问 key

我创建了一个新的I-AM用户设置该用户权限以完全访问S3然后我看到MacBook的环境变量具有正确的Key和Key-ID。然后我关注了亚马逊文档http://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/common-examples.html#s3列出我所有的桶,我收到了错误无法列出存储桶EnvAccessKeyNotFound:在环境中找不到AWS_ACCESS_KEY_ID或AWS_ACCESS_KEY不知道为什么不能识别我的代码funcUploadProfile(){svc:=s3.New(session.New(&aws.

go - 如何导入项目特定的 go 包,同时为完全不同的项目通用的 go 包维护一个单独的位置?

所以我第一次开发了一个go应用程序。我开始知道有两个变量GOROOT和GOPATH用于维护go包。目前我的理解是,GOROOT是存放go二进制文件的,GOPATH主要是存放项目需要的库和辅助包。这是我当前的项目结构-/Users/john/work/project-mars/Users/john/work/project-mars/main.go/Users/john/work/project-mars/helper/Users/john/work/project-mars/helper/helper.gomain.go的内容packagemainimport("fmt""helper

golang 在子目录中找不到包 gin

我收到以下错误消息:controllers/user.go:4:2:cannotfindpackage"(underscore)/home/ubuntu/goapi/src/github.com/roes/api/vendor/github.com/gin-gonic/gin"inanyof:/usr/local/go/src/(underscore)/home/ubuntu/goapi/src/github.com/roes/api/vendor/github.com/gin-gonic/gin(from$GOROOT)/home/ubuntu/goapi/src/_(undersc

c - 找不到gmp库

我试着安装依赖gmp的pbc库。Dockerfile:FROMgolang:1.9.6-alpine3.7RUNmkdir-p/go/src/appWORKDIR/go/src/appCOPY./go/src/appRUNapkadd--updategitgccbuild-baseflexbisongmpRUNwgethttps://crypto.stanford.edu/pbc/files/pbc-0.5.14.tar.gz&&\tar-xvfpbc-0.5.14.tar.gz&&\cdpbc-0.5.14&&\./configure--prefix=$HOME/.local&&\m

Golang `go get` - 找不到任何包

我关注了thisguide在Ubuntu16.04上安装Go。但是,当我按照installationinstructions对于Go应用程序(gogetgithub.com/src-d/enry/cmd/enry),我收到以下错误:packagegithub.com/src-d/enry/v2:cannotfindpackage"github.com/src-d/enry/v2"inanyof:/usr/local/go/src/github.com/src-d/enry/v2(from$GOROOT)/root/work/src/github.com/src-d/enry/v2(fr

go - LiteIDE 在您保存时删除导入

liteIDE的行为有点奇怪。我确实去获取了mgo.v2包并且gopath是正确的。当我手动输入导入语句“gopkg.in/mgo.v2”时自动完成工作。我得到了mgo的Dial,..功能。但是在按下“ctrl+s”之后导入消失了,尽管我的代码中使用了mgo函数。想知道它是否是liteIDE中的错误。我使用的是liteIDE24.2版packagemainimport("fmt""log""gopkg.in/mgo.v2/bson")typePersonstruct{NamestringPhonestring}funcmain(){session,err:=mgo.Dial("serv

html - 系统找不到试图解析模板的指定路径

我刚刚开始学习Go中的html/模板。我收到的错误是“系统找不到指定的文件路径”。文件路径为templates/time.html。time.html(我要呈现的页面)的位置是src/templates/time.html我的gomain的位置是src/timeserver/timerserver.go这是我使用的代码funcTimeServer(whttp.ResponseWriter,req*http.Request){//ifusergoestoanotherwebsiteaftertime/...ifreq.URL.Path!="/time/"{errorHandler(w,r

go - 导入 mgo 驱动程序时出错

我正在尝试使用mgo驱动程序。我跑gogetgopkg.in/mgo.v2获取包,却出现这些错误-#gopkg.in/mgo.v2/internal/scram/usr/local/go/src/pkg/gopkg.in/mgo.v2/internal/scram/scram.go:86:c.out.Growundefined(typebytes.BufferhasnofieldormethodGrow)/usr/local/go/src/pkg/gopkg.in/mgo.v2/internal/scram/scram.go:87:c.authMsg.Growundefined(typ